import axios, {AxiosInstance} from "axios";

const request: AxiosInstance = axios.create({
    baseURL: import.meta.env.VITE_BASE_URL,
    timeout: 30000, // 请求超时时间
    withCredentials: false, // 禁用 Cookie 等信息
});
request.interceptors.request.use((config) => {
    return config;
}, (error) => {
    return Promise.reject(error);
});

request.interceptors.response.use((response) => {
    return response;
}, (error) => {
    return Promise.reject(error);
});
export default request;
